Skip to content

Add as-lan as a built-in SDK#113

Merged
tomusdrw merged 21 commits intomainfrom
td-aslan-framework
May 8, 2026
Merged

Add as-lan as a built-in SDK#113
tomusdrw merged 21 commits intomainfrom
td-aslan-framework

Conversation

@tomusdrw
Copy link
Copy Markdown
Member

@tomusdrw tomusdrw commented May 8, 2026

Summary

  • Adds the as-lan AssemblyScript framework as a first-class SDK alongside jam-sdk, jambrains, jade, ajanta, and jamc3. Users can now write sdk: as-lan (or sdk: as-lan-0.0.4, or canonical sdk: aslan-0.0.4) in jammin.build.yml and jammin auto-resolves the docker image and build/test commands.
  • Introduces a small alias resolution layer: SDK_ALIASES map + resolveSdkId (string → canonical key) + resolveSdk (string|object → SdkConfig). Build/test commands now go through resolveSdk instead of duplicating the lookup logic in two places.
  • Registers aslan as a jammin create --template aslan choice scaffolding from jammin-create/jammin-create-aslan.
  • Updates service-examples.md and getting-started.md so users actually find the new SDK in docs.

Design / plan

  • Spec: docs/superpowers/specs/2026-04-28-aslan-framework-design.md
  • Plan: docs/superpowers/plans/2026-04-28-aslan-framework.md

Notes

  • The image is pinned to ghcr.io/tomusdrw/jammin-as-lan:0.0.4. Migrating to ghcr.io/fluffylabs/jammin-as-lan is intentionally deferred — see the spec's "Non-goals" section.
  • The bare as-lan alias follows whichever aslan-X.Y.Z is the current default. Users who want reproducibility should pin as-lan-0.0.4 (this is now noted in the docs).

Test plan

  • bun run qa clean
  • bun run build clean (SDK and CLI both build without TS errors)
  • bun test — 164 pass, 1 skip, 0 fail (added 8 tests in test-command.test.ts, plus alias coverage in sdk-configs.test.ts, config-validator.test.ts, and build-command.test.ts)
  • Smoke test: validateBuildConfig({ services: [{ path, name, sdk: "as-lan" }] }) returns the parsed config with sdk: "as-lan"
  • Smoke test: resolveSdk("as-lan") returns the canonical aslan-0.0.4 config object
  • Manual: jammin create my-aslan-app --template aslan scaffolds correctly (requires the create-aslan template repo, not yet exercised end-to-end in this branch)
  • Manual: jammin build against an as-lan service produces service.jam (requires docker pull and a real as-lan service tree)

🤖 Generated with Claude Code

tomusdrw and others added 20 commits April 28, 2026 15:22
Documents the plan to register as-lan as a built-in SDK in SDK_CONFIGS,
with bare and versioned alias support so users no longer need to inline
image/build/test in their service config.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the merge-blocker dependency note: ghcr.io/tomusdrw/jammin-as-lan:0.0.4
is already published and uses an entrypoint symlink so lean
npm run build / npm test work without per-build npm install.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bite-sized TDD task breakdown covering SDK_CONFIGS entry, alias map,
resolver helper, validator updates, build/test command consumption,
create-command template registration, and docs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The interactive create-command flow already offers these three templates,
but the docs only listed jam-sdk, jade, and jambrains. Bring the docs in
sync with the actual template registry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tests in bin/cli/ import @fluffylabs/jammin-sdk via package name, which
resolves to packages/jammin-sdk/dist/. After SDK source edits, bun run build
must run before bun test locally. CI already chains build before test so
this only matters during local development.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9e029316-dc2f-4e68-ac3c-744130ac0509

📥 Commits

Reviewing files that changed from the base of the PR and between b995067 and 0b06504.

📒 Files selected for processing (14)
  • .gitignore
  • AGENTS.md
  • bin/cli/src/commands/build-command.test.ts
  • bin/cli/src/commands/build-command.ts
  • bin/cli/src/commands/create-command.ts
  • bin/cli/src/commands/test-command.test.ts
  • bin/cli/src/commands/test-command.ts
  • docs/src/getting-started.md
  • docs/src/service-examples.md
  • packages/jammin-sdk/config/config-validator.test.ts
  • packages/jammin-sdk/config/config-validator.ts
  • packages/jammin-sdk/config/sdk-configs.test.ts
  • packages/jammin-sdk/config/sdk-configs.ts
  • packages/jammin-sdk/config/types/config.ts

📝 Walkthrough

Walkthrough

This PR introduces aslan-0.0.4 as a built-in SDK with alias support (as-lan, as-lan-0.0.4), updates type and validation contracts, modifies CLI commands to resolve aliases, and extends documentation with new templates and Docker workflow instructions.

Changes

SDK Registry and CLI Integration

Layer / File(s) Summary
SDK Registry and Aliases
packages/jammin-sdk/config/sdk-configs.ts
SDK_CONFIGS gains canonical entry aslan-0.0.4 with Docker image, build, and test commands. New SDK_ALIASES maps as-lan and as-lan-0.0.4 to the canonical key. New resolveSdkId() resolves canonical or alias IDs to canonical keys. New resolveSdk() resolves strings or inline SdkConfig objects to concrete configs, throwing on unknown IDs.
Type and Validation Contracts
packages/jammin-sdk/config/types/config.ts, packages/jammin-sdk/config/config-validator.ts
ServiceConfig.sdk type expanded to accept keyof typeof SDK_ALIASES alongside existing canonical IDs and inline SdkConfig. Validation schema updated to accept both ID sets with combined error messaging.
SDK Foundation Tests
packages/jammin-sdk/config/sdk-configs.test.ts, packages/jammin-sdk/config/config-validator.test.ts
Comprehensive tests verify alias mappings, resolveSdkId and resolveSdk behavior, validator acceptance/rejection of supported/unsupported IDs, and type compatibility for aliases in ServiceConfig.
Build Command SDK Resolution
bin/cli/src/commands/build-command.ts, bin/cli/src/commands/build-command.test.ts
callDockerBuild updated to use resolveSdk() instead of direct SDK_CONFIGS indexing. Tests verify alias resolution to concrete config, error messaging for unknown SDK IDs, and Docker command generation.
Test Command SDK Resolution
bin/cli/src/commands/test-command.ts, bin/cli/src/commands/test-command.test.ts
testService updated to use resolveSdk() for SDK resolution. Comprehensive test suite covers multiple SDK IDs/aliases, Docker command construction, service path mounting, failure paths, and stdout capture.
Create Command Template Registration
bin/cli/src/commands/create-command.ts
Template union and TARGETS mapping updated to include aslan template, making it selectable in CLI and interactive creation.

Documentation and Configuration

Layer / File(s) Summary
Developer Guidance
AGENTS.md
New section documents that packages/jammin-sdk/ edits require running bun run build before bun test locally, since tests import the published SDK from dist/; CI handles the build automatically.
User Documentation
docs/src/getting-started.md, docs/src/service-examples.md
Getting-started guide extended with ajanta, jamc3, and aslan template options. New "as-lan" subsection documents Docker image workflow: pulling ghcr.io/tomusdrw/jammin-as-lan:0.0.4, running build and test commands with /app volume mounts, entrypoint behavior for node_modules symlinking, and SDK alias documentation.
Repository Configuration
.gitignore
Adds rule to ignore docs/superpowers/ directory (internal planning artifacts).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • FluffyLabs/jammin#71: Both PRs modify the CLI test/build command implementations and refactor SDK configuration resolution in those same functions.
  • FluffyLabs/jammin#102: Both PRs move and configure SDK config utilities into @fluffylabs/jammin-sdk and update the CLI to consume those exported APIs.
  • FluffyLabs/jammin#54: Both PRs modify build command SDK resolution logic and introduce or update resolveSdk usage patterns.

Suggested reviewers

  • mateuszsikora
  • skoszuta
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Add as-lan as a built-in SDK' directly and clearly summarizes the main change: introducing as-lan as a built-in SDK option for users.
Description check ✅ Passed The PR description is comprehensive and directly related to the changeset, detailing the addition of as-lan SDK support, the alias resolution layer, template registration, and documentation updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch td-aslan-framework

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bin/cli/src/commands/build-command.test.ts`:
- Line 168: The test is missing awaiting the rejection assertion, which can
cause false positives; update the test that calls callDockerBuild(service,
"/test/project") so the expect(...).rejects.toThrow("Unknown SDK id:
'definitely-not-a-real-sdk'") is prefixed with await (i.e., await
expect(callDockerBuild(...)).rejects.toThrow(...)) to ensure the promise
rejection is actually asserted in the async test.

In `@bin/cli/src/commands/test-command.test.ts`:
- Around line 156-158: The failing test uses .rejects without awaiting and calls
testService twice; change those assertions to await expect(testService(service,
"/test/project")).rejects.toThrow() and await expect(testService(service,
"/test/project")).rejects.toThrow("Tests failed for service 'failing-service'")
(or combine into a single awaited assertion that checks the message) so the
promise is awaited and the duplicate invocation of testService is removed;
update any other occurrences (e.g., the similar assertion near line 168) to use
await expect(...).rejects.toThrow(...) as well.

In `@docs/src/service-examples.md`:
- Around line 89-104: Remove the shell prompt characters from the console code
blocks in docs/src/service-examples.md: replace lines that start with "$ "
inside the three ```console``` blocks (the docker pull, the cd + docker run
build, and the docker run npm test examples) with the same commands but without
the leading "$ " so the blocks contain only the raw commands; ensure each block
remains fenced with ```console``` at start and end and that spacing/newlines are
preserved.

In `@docs/superpowers/plans/2026-04-28-aslan-framework.md`:
- Around line 203-211: The resolveSdkId function uses the `in` operator which
checks the prototype chain and can cause prototype pollution; change its
property checks to use Object.hasOwn to only test own properties on SDK_CONFIGS
and SDK_ALIASES (i.e., replace `id in SDK_CONFIGS` and `id in SDK_ALIASES` with
Object.hasOwn calls) and keep the same return behavior (returning the id cast to
keyof typeof SDK_CONFIGS or resolving via SDK_ALIASES) so callers of
resolveSdkId are unaffected.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bfddf2c9-0a35-4381-bfef-42918b062745

📥 Commits

Reviewing files that changed from the base of the PR and between b995067 and 1b0187a.

📒 Files selected for processing (15)
  • AGENTS.md
  • bin/cli/src/commands/build-command.test.ts
  • bin/cli/src/commands/build-command.ts
  • bin/cli/src/commands/create-command.ts
  • bin/cli/src/commands/test-command.test.ts
  • bin/cli/src/commands/test-command.ts
  • docs/src/getting-started.md
  • docs/src/service-examples.md
  • docs/superpowers/plans/2026-04-28-aslan-framework.md
  • docs/superpowers/specs/2026-04-28-aslan-framework-design.md
  • packages/jammin-sdk/config/config-validator.test.ts
  • packages/jammin-sdk/config/config-validator.ts
  • packages/jammin-sdk/config/sdk-configs.test.ts
  • packages/jammin-sdk/config/sdk-configs.ts
  • packages/jammin-sdk/config/types/config.ts

Comment thread bin/cli/src/commands/build-command.test.ts Outdated
Comment thread bin/cli/src/commands/test-command.test.ts Outdated
Comment thread docs/src/service-examples.md
Comment thread docs/superpowers/plans/2026-04-28-aslan-framework.md Outdated
- Remove docs/superpowers/ planning artifacts from source control and
  add the directory to .gitignore. The mdBook user docs under docs/src/
  stay tracked.
- Await `.rejects.toThrow(...)` calls in build-command.test.ts and
  test-command.test.ts so async rejections are actually asserted (per
  CodeRabbit feedback). Combine the duplicate failing-exit-code calls
  into a single awaited assertion checking the specific error message.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tomusdrw tomusdrw enabled auto-merge (squash) May 8, 2026 11:37
@tomusdrw tomusdrw disabled auto-merge May 8, 2026 19:14
@tomusdrw tomusdrw enabled auto-merge (squash) May 8, 2026 19:14
@tomusdrw
Copy link
Copy Markdown
Member Author

tomusdrw commented May 8, 2026

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

✅ Actions performed

Full review triggered.

@tomusdrw tomusdrw disabled auto-merge May 8, 2026 19:43
@tomusdrw tomusdrw merged commit 7e35d96 into main May 8, 2026
8 checks passed
@tomusdrw tomusdrw deleted the td-aslan-framework branch May 8, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant